Skip to content

fix: propagate SIGINT exit status on POSIX#586

Open
lawrence3699 wants to merge 1 commit intoopen-cli-tools:mainfrom
lawrence3699:fix/propagate-sigint-exit-status
Open

fix: propagate SIGINT exit status on POSIX#586
lawrence3699 wants to merge 1 commit intoopen-cli-tools:mainfrom
lawrence3699:fix/propagate-sigint-exit-status

Conversation

@lawrence3699
Copy link
Copy Markdown

Fixes #470

When concurrently itself receives SIGINT on POSIX, it currently exits with code 0 after shutting down its children. That makes shell callers treat Ctrl+C as success, so && chains continue running.

This keeps the existing shutdown flow for child commands, but once the run finishes it re-sends SIGINT to the concurrently process on POSIX so the parent shell observes an interrupted command instead of a successful exit. Windows behavior stays unchanged.

Validation:

  • pnpm build
  • pnpm test -- --run bin/index.spec.ts -t 'propagates SIGINT on POSIX when interrupted'
  • Reproduced the issue before and after with bash -lc 'node dist/bin/index.js "exec sleep 1000" "exec sleep 2000" && echo STILL_HERE' and a SIGINT sent to the process group: before the patch it printed STILL_HERE, after the patch it exited with SIGINT and did not print it

Copilot AI review requested due to automatic review settings April 19, 2026 09:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

concurrently exitcode=0 when it receives SIGINT itself (e.g. on ^C)

2 participants